package com.zby.scms.controller;

import com.zby.scms.entity.RolePerms;
import com.zby.scms.service.RolePermsService;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 角色1---->n权限联系表(RolePerms)表控制层
 *
 * @author zhangboyi
 * @since 2019-12-31 20:24:12
 */
@Api(tags = "角色1---->n权限联系表(RolePerms)") 
@RestController
@RequestMapping("rolePerms")
public class RolePermsController {
    /**
     * 服务对象
     */
    @Autowired
    private RolePermsService rolePermsService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "根据id查询 角色1---->n权限联系表")
    @GetMapping("selectOne/{id}")
    public RolePerms selectOne(@ApiParam(value = "关联ID ID") @PathVariable("id") Integer id) {
        return this.rolePermsService.queryById(id);
    }

}